package com.moli.iov.down.command.design.command.param.result.impl;

import com.moli.iov.down.enums.LeasingModeEnum;
import com.moli.iov.down.model.dto.req.VehicleParamDto;
import com.moli.iov.down.command.codec.decode.bean.extend.QueryResExtendBean;
import com.moli.iov.down.command.design.command.param.result.ParamQueryResultCommand;

/**
 * <p>
 *  终端租赁模式： 0x01 非租赁模式； 0x02 租赁模式
 * </p>
 *
 * @author: zql
 * @Date: 2019/4/26 18:16
 */
public class LeasingModeCommand implements ParamQueryResultCommand {

    @Override
    public VehicleParamDto execute(VehicleParamDto vehicleParamDto, QueryResExtendBean qreb) {

        vehicleParamDto.setRentSalePattern(Integer.parseInt(qreb.getValue()));
        vehicleParamDto.setRentSalePatternStr(LeasingModeEnum.getMsg(Integer.parseInt(qreb.getValue())));
        return vehicleParamDto;
    }
}
